package com.niiwoo.civet.account.service.dubbo;

import com.alibaba.dubbo.config.annotation.Service;
import com.niiwoo.civet.account.dao.entity.PayChannelBank;
import com.niiwoo.civet.account.dao.mapper.PayChannelBankMapperExt;
import com.niiwoo.civet.account.dto.response.PayChannelBankResponseDTO;
import com.niiwoo.civet.account.service.PayChannelBankDubboService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

@Slf4j
@Service(version = "1.0.0")
public class PayChannelBankDubboServiceImpl implements PayChannelBankDubboService {

    @Autowired
    private PayChannelBankMapperExt payChannelBankMapperExt;
    /*@Autowired
    private PayChannelRouteBankMapperExt payChannelRouteBankMapperExt;*/

    public PayChannelBankResponseDTO getOptimalPayChannelBankByBankType(Long bankTypeId) {
        PayChannelBankResponseDTO responseDTO = new PayChannelBankResponseDTO();
        PayChannelBank payChannelBank = payChannelBankMapperExt.getOptimalPayChannelBankByBankType(bankTypeId);
        if( null != payChannelBank ){
            BeanUtils.copyProperties(payChannelBank,responseDTO);
            return responseDTO;
        }
        return null;
    }
}
